<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            width: 200px;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="fn1">修改跳转地址</button>
        <button @click="fn2">改照片</button>
        <!-- 这个href属性跟url有关，url是什么，href的值就是什么 -->
        <a v-bind:href="url" target="_blank">点我跳转</a>
        <img v-bind:src="pic" alt="">

        <hr>

        <!-- v-bind:的简写形式就是把v-bind去掉就留冒号 -->
        <!-- 语法： :属性名="数据" -->
        <a :href="url" target="_blank">点我跳转</a>
        <img :src="pic" alt="">
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                url: 'http://www.itcast.cn',
                pic: './girl.png'
            },

            methods: {

                fn1 () {
                    this.url = 'http://www.zllhyy.cn'
                },

                fn2 () {

                    this.pic = './wyz.png'
                }
            }
        })
    </script>
</body>
</html>